<div class="crumbs">
	<h3>用户列表</h3>
	<p><a ui-sref="main.fast-pay">快捷收款</a> > 用户列表</p>
</div>

<div class="content-box">
	<div class="form-inline form-group">

		<select class="form-control input-sm " ng-init="userAuditStatusS=[{code:0,desc:'未提交'},{code:1,desc:'未审核'},{code:2,desc:'已通过'},{code:3,desc:'未通过'}]" ng-options="v.code as v.desc for v in userAuditStatusS" ng-model="list.userAuditStatus">
			<option value="">--身份认证信息--</option>
		</select>

		<select class="form-control input-sm " ng-init="bindingCards=[{code:true,desc:'已绑定'},{code:false,desc:'未绑定'}]" ng-options="v.code as v.desc for v in bindingCards" ng-model="list.bindingCard">
			<option value="">--绑定收款银行卡--</option>
		</select>

		<select class="form-control input-sm " ng-init="getPermissions=[{code:true,desc:'启用'},{code:false,desc:'禁用'}]" ng-options="v.code as v.desc for v in getPermissions" ng-model="list.getPermission">
			<option value="">--快捷收款权限--</option>
		</select>


		<select class="form-control input-sm " ng-init="isTwitters=[{code:true,desc:'是'},{code:false,desc:'否'}]" ng-options="v.code as v.desc for v in isTwitters" ng-model="list.isTwitter">
			<option value="">--是否是推客--</option>
		</select>

		<select class="form-control input-sm " ng-init="withdrawDeposits=[{code:true,desc:'是'},{code:false,desc:'否'}]" ng-options="v.code as v.desc for v in withdrawDeposits" ng-model="list.withdrawDeposit">
			<option value="">--是否存在提现申请--</option>
		</select>

		<div class="float-right">
			<div class="input-append date form_datetime_start inline-block">
				<i class="add-on pa mt30"><i class="icon-th"></i></i>
				<input class=" form-control input-sm" size="16" placeholder="注册开始时间段" type="text" onkeyup="this.value=''" id="beginTime">
			</div> ----
			<div class="input-append date form_datetime_end inline-block">
				<i class="add-on pa mt30"><i class="icon-th"></i></i>
				<input class=" form-control input-sm" size="16" type="text" placeholder="注册结束时间段" onkeyup="this.value=''" id="endTime">
			</div>
			<input type="hidden" ng-class="{err:!dateThan==''}">
			<i class="f12 c-red">{{dateThan}}</i>
			<input type="text" class="form-control input-sm" placeholder="手机号/姓名" maxlength="30" size="30" ng-model="list.searchKey">
			<div class="inline-block f12 ">
				<button type="button" class="btn btn-primary btn-sm  input-sm " ng-click="submitSearch(list)">查询</button>
				<button type="button" class="btn btn-primary btn-sm  input-sm " ng-click="createExcel(list)">一键生成Excel表</button>
			</div>
		</div>

	</div>

	<table class=" table   table-hover table-condensed  table-striped text-center ">
		<thead style="background:#8A8BC4; color: #fff">
			<tr>
				<td>手机号</td>
				<td>姓名</td>
				<td>注册快捷收款时间</td>
				<td>身份认证信息</td>
				<td>绑定收款银行卡</td>
				<td>收款银行卡信息</td>
				<td>收款手续费率</td>
				<td>收款笔数 / 金额</td>
				<td>快捷收款权限</td>
				<td>是否是推客</td>
				<td>推客权限</td>
				<td>存在提现申请</td>
				<td>操作</td>
			</tr>
		</thead>
		<tbody>
			<style>
				.table-striped > tbody > tr.td_2verticalCenter td{
					vertical-align: middle;
				}
			</style>																				
			<tr ng-repeat="g in grid.result" class="td_2verticalCenter">
				<td ng-bind="g.phone"></td>
				<td ng-bind="g.name"></td>
				<td>{{g.registerTime |date:'yyyy-MM-dd HH:mm:ss'}}</td>
				<td>
					{{g.userAuditStatusDesc}}
					<a style="cursor: pointer;" ng-click="identityAuthenticationInfo(g)" ng-if="g.userAuditStatus !=0">（<span class="c-blue">查看</span>）</a>
				</td>
				<!-- 身份认证信息 -->
				<td>{{g.bindingCard===true?'已绑定':'未绑定'}}</td>
				<td>{{g.bankName}} <i ng-if="g.cardNo">（{{g.cardNo | space4}}）</i></td><!-- 收款银行卡信息 -->
				<td>{{g.baseAuth.getRate | point2}}%+{{g.baseAuth.poundage}}元</td><!-- 收款手续费率 -->
				
				<td>{{g.userPosCount}} / {{g.userPosAmount.toFixed(2)}}</td><!-- 收款笔数 / 金额 -->
				
				<td>{{g.baseAuth.get===2?'启用':g.baseAuth.get===1?'未启用':g.baseAuth.get===3?'禁用':''}}</td><!-- 快捷收款权限 -->
				
				<td>{{g.baseAuth.twitterStatus===2?"是":"否"}}</td><!-- 是否是推客 -->
				
				<td><!-- 推客权限 -->
					<i ng-if="g.baseAuth.develop===2">发展下级推客<br></i>
                    <i ng-if="g.baseAuth.spread===2">发展收款客户</i>
                    
                </td>
				
				<td>{{g.withdrawDepositApply===true?'是（'+g.withdrawDepositAmount.toFixed(2)+'）':'否'}}</td><!-- 存在提现申请 -->
				
				<td>
					<button class="btn btn-primary btn-xs" ng-click="createDialog(g)">修改权限及费率</button>
					<button class="btn btn-success btn-xs ml10" ng-if="g.withdrawDepositApply" ng-click="createDialogPayAdd([g.id,g.withdrawDepositAmount,g.userId])">处理提现申请</button>
				</td>
			</tr>
			<tr ng-if="!grid.result">
				<td colspan="9" class="f12 c-999 ">没有相关数据!</td>
			</tr>
		</tbody>
	</table>
	<div ng-include="'/templates/partial/page.html'" style="height: 50px;background-color: #f4f4f6"></div>
</div>

<!--dialog 修改权限-->
<div class="modal fade createDialog ">
	<div class="modal-dialog " style="width: 600px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">修改权限</h4>
			</div>
			<div class="modal-body">
				<div class="dialog-content ml20 ">
					<dl class="  form-inline form-group">
						<dd>
							<span class=" f14 c-666 lh200"><i style="letter-spacing: 1em">姓</i>名：</span>{{rootSet.name}}
						</dd>
						<dd>
							<span class=" f14 c-666 lh200">手机号：</span>{{rootSet.phone}}
						</dd>
						<dd>
							<span class=" f14 c-666  v-top"><i style="letter-spacing: 1em">权</i>限：</span>
							<label>
                                <input type="checkbox" class="v-top" ng-model="roots.get"/>快捷收款</label>&nbsp;&nbsp;&nbsp;手续费率：
                                <input type="text" name="points" style="width:50px;" class="form-control input-sm" maxlength="4" onkeyup="if(value>1)value=1" ng-model="roots.getRate">%+{{roots.poundage}}元
                                <i class="c-red">（最低0.43%）</i>
                                <div style="margin-left: 124px;font-weight: bold;margin: 10px;margin-right: 65px;" class="f12 text-right">
                                	<p ng-if="!roots.twitterStatus">开通推客权限，会自动调整为0.45%，可以手动修改</p>
									<p ng-if="roots.twitterStatus">关闭推客权限，会自动调整为0.58%，可以手动修改</p>
                                </div>
							<div class="inline-block lh200" style="margin-left: 124px;">
								<label><input type="checkbox" style="vertical-align: text-top;" ng-model="roots.twitterStatus"/>推客</label>
								<div class="tabFlex">
									<label><input type="checkbox" style="vertical-align: text-top;" ng-model="roots.develop" ng-disabled="roots.disabled"/>发展下级推客</label>
									<label><input type="checkbox" style="vertical-align: text-top;" ng-model="roots.spread" ng-disabled="roots.disabled"/>发展收款客户</label>
								</div>
								<style>
									.tabFlex {
										display: inline-flex;
										flex-direction: column;
										margin-left: 38px;
									}
								</style>
								<div class="c-red">
									<p>警告：修改推客权限请慎重！</p>
									<p>1、普通用户开通推客权限，将跟发展他进来的推客解除关系</p>
									<p>2、推客被取消推客权限后，将跟他的上下级推客及客户解除关系</p>
									<p>上述关系解除后无法恢复！</p>
								</div>
							</div>

						</dd>

						<p class="text-center c-red f12 "> <i class="loading f12 c-green block"></i>{{roots.errorMsg}}</p>
					</dl>

				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary " ng-click="createDialogSumbitRoot(roots)">提交</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!--dialog 处理提现申请-->
<div class="modal fade createDialog2 ">
	<div class="modal-dialog " style="width: 750px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">处理提现申请</h4>
			</div>
			<div class="modal-body">
				<div class="dialog-content ml20 ">
					<dl class="  form-inline form-group">
						<dd>
							<span>提现金额：</span>{{pay.amount}}
						</dd>

						<dd>
							<span>打款方式：</span>
							<select class="form-control" ng-options="v.code as v.desc for v in payToolTypes" ng-model="pay.payMode " ng-required="true">
								<option value="">--选择打款方式--</option>
							</select>
						</dd>
						<dd>
							<span class="v-top">上传凭证：</span>
							<div class="inline-block">
								<button type="button" class="btn btn-info " id="upPhotosBtn"> 上传图片 <i></i></button>
								<i class=" f12 c-999 ml10">(图片比例不限、图片宽度1000像素以上； 建议大小1MB-10MB之间)</i>
								<div class="img-show-box create-dialog"></div> <input type="hidden" ng-model="pay.voucher" />
							</div>
						</dd>

						<dd>
							<span>备注：</span>
							<input type="text" class="form-control " maxlength="50" size="50" placeholder="50字以内" ng-model="pay.remark" /> <i class=" f12 c-999 ml10">（选填）</i>
						</dd>
						<p class="text-center c-red f12 "> <i class="loading f12 c-green block"></i>{{pay.errorMsg}}</p>
					</dl>

				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary " ng-click="createDialogSumbitPay(pay)">提交</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!--dialog 查看身份认证信息-->
<div class="modal fade createDialog3 ">
	<div class="modal-dialog " style="width: 700px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">身份认证信息</h4>
			</div>
			<div class="modal-body">
				<div class="dialog-content ml20 ">
					<dl class="  form-inline form-group">
						<dd>
							<span class=" f14 c-666 lh200"><i style="letter-spacing: 2em;">姓</i>名：</span>{{auditInfo.realName}}
						</dd>
						<dd>
							<span class=" f14 c-666 lh200">身份证号：</span>{{auditInfo.idCardNo}}
						</dd>
						<dd>
							<span class=" f14 c-666 lh200">收款卡号：</span>{{auditInfo.cardNO}}
						</dd>
						<dd>
							<div class="inline-block lh200 flex">
								身份证正面照：
								<a ng-if="auditInfo.idImageA" ng-href="{{auditInfo.idImageA}}" target="_blank"><img  width="150" ng-src="{{auditInfo.idImageA}}" alt=""></a>
								身份证反面照：
								<a ng-if="auditInfo.idImageB" ng-href="{{auditInfo.idImageB}}" target="_blank"><img  width="150" ng-src="{{auditInfo.idImageB}}" alt=""></a>
							</div>
							<div class="inline-block lh200 flex mt50">
								身份证正面持证照：
								<a ng-if="auditInfo.idHoldImage" ng-href="{{auditInfo.idHoldImage}}" target="_blank"><img  width="150" ng-src="{{auditInfo.idHoldImage}}" alt=""></a>
								收款银行卡正面照：
								<a ng-if="auditInfo.posCardImage" ng-href="{{auditInfo.posCardImage}}" target="_blank"><img  width="150" ng-src="{{auditInfo.posCardImage}}" alt=""></a>
							</div>
							<style>
								.flex {
									display: flex;
									justify-content: space-around;
									flex-wrap: wrap;
									align-items: center;
								}
								
								.flex a {
									display: block;
								}
								
								.flex a img {
									vertical-align: middle;
								}
							</style>
						</dd>

						<p class="text-center c-red f12 "> <i class="loading f12 c-green block"></i>{{roots.errorMsg}}</p>
					</dl>

				</div>
			</div>
			<div class="modal-footer" ng-if="auditInfo.userAuditStatus!=3">
				<button type="button" class="btn btn-danger" ng-if="auditInfo.userAuditStatus===1 || auditInfo.userAuditStatus===2" ng-click="auditNoPass()">审核不通过</button>
				<button type="button" class="btn btn-primary" ng-if="auditInfo.userAuditStatus===1" ng-click="audit(true,auditInfo.posId,updateKey)">审核通过</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->

<!--dialog 审核不通过填写原因-->
<div class="modal fade createDialog4 ">
	<div class="modal-dialog " style="width: 450px">
		<div class="modal-content">
			<div class="modal-header">
				<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
				<h4 class="modal-title">原因</h4>
			</div>
			<div class="modal-body">
				<div class="dialog-content ml20 ">
					<dl class="  form-inline form-group">
						<dd>
							<textarea name="" rows="5" cols="50" maxlength="50" placeholder="50字以内" ng-model="rejectReason"></textarea>
						</dd>
						<p class="text-center c-red f12 "> <i class="loading f12 c-green block"></i>{{errorMsg}}</p>
					</dl>

				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-primary " ng-click="audit(false,auditInfo.posId,updateKey,rejectReason)">提交</button>
			</div>
		</div>
		<!-- /.modal-content -->
	</div>
	<!-- /.modal-dialog -->
</div>
<!-- /.modal -->
